From: Georges Basile Stavracas Neto Date: Tue, 11 Feb 2020 13:39:22 +0000 (-0300) Subject: userWidget: Add empty label when user is null X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~777^2^2~64 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=261d6d35f5db5cee3c2263d77370205ff92ccf3e;p=gnome-shell.git userWidget: Add empty label when user is null Currently, when a null user is passed, we don't add any username label. That makes the layout of user and no-user cases inconsistent. Add a ghost label with no opacity to mimic the username label. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/922 --- diff --git a/js/ui/userWidget.js b/js/ui/userWidget.js index d21552555..e5f788338 100644 --- a/js/ui/userWidget.js +++ b/js/ui/userWidget.js @@ -225,6 +225,14 @@ class UserWidget extends St.BoxLayout { this._userLoadedId = this._user.connect('notify::is-loaded', this._updateUser.bind(this)); this._userChangedId = this._user.connect('changed', this._updateUser.bind(this)); + } else { + this._label = new St.Label({ + style_class: 'user-widget-label', + text: 'Empty User', + opacity: 0, + }); + this.add_child(this._label); + } this._updateUser();